/** ****************************************************************************
 * CopyRight (C) 2012 Sharadendu Sinha.
 * Licensing : FreeBSD 
 *
 * @(#) $Id$
 */
package com.sps.signalling;

import java.util.concurrent.Executor;

import com.sps.signalling.Slot.SlotHandler;

/**
 * Base interface for all invokable connection
 * 
 * @version 1.1
 * @author sharadendu
 */
public interface InvokableConnection
{
	/**
	 * enum specifying the connection types {@link #DIRECT} - the invocation
	 * of the {@link SlotHandler} happens on the same thread which emitted the
	 * {@link Signal} {@link #THREADED} - the invocation of the
	 * {@link SlotHandler} may happen on a different thread depending on the
	 * {@link Executor} provided by {@link SlotProvider}
	 * 
	 * @version 1.1
	 * @author sharad
	 */
	enum Type {
		DIRECT, THREADED
	}

	/**
	 * This is the {@link Signal} to which another {@link Invokable} as obtained
	 * from {@link #getDestinationInvokable()} is connected
	 * 
	 * @return {@link Signal}
	 */
	Signal getSourceInvokable();

	/**
	 * This is the {@link Invokable} that is connected to the {@link Signal} as
	 * obtained from {@link #getSourceInvokable()}
	 * 
	 * @return {@link Invokable}
	 */
	Invokable getDestinationInvokable();

	/**
	 * Returns the connection type of this connection
	 * 
	 * @return {@link Type}
	 */
	Type getType();
}
